AFRAME.registerComponent("portal", {
    schema:{
        url:{type:'string',default:'maze-index.html'}
    },
    init: function () {
        this.el.addEventListener('collide', (evt) => {
            console.log('evt.detail.body.el',evt.detail.body.el);
            if (evt.detail.body.el.id != undefined && evt.detail.body.el.id == "player") {
                console.error('传送开启');
                location.href =this.data.url;
            }
        });
    }
})


